//
//  HLENetWorkConfig.m
//  HLENetwork_Example
//
//  Created by hle1879 on 2020/9/28.
//  Copyright © 2020 13434436448@163.com. All rights reserved.
//

#import "HLENetWorkConfig.h"
#import  <AFNetworking/AFNetworking.h>
#import "HLEConst.h"

@implementation HLENetWorkConfig

+ (instancetype)defaultConfig{
    HLENetWorkConfig *config = [HLENetWorkConfig new];
    return config;
}

-(instancetype)init{
    self = [super init];
    if (self) {
        self.baseURL = nil;
        self.requestSerializer = HLERequestSerializerDefault;
        self.responseSerializer = HLEResponseSerializerDefault;
        self.timeoutInterval = HLE_Request_Timeout;
        self.requestHeader = [NSDictionary new];
        self.publicParams = [NSDictionary  new];
        self.cacheNeedlessParamsForKeys = [NSArray new];
        self.securityPolicy = [AFSecurityPolicy defaultPolicy];
        self.cachePath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:HLE_Default_Cache_DiskPath];
        self.sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
        self.activityIndicatorOpen = NO;
        self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/html", @"text/json", @"text/plain", @"text/javascript", @"text/xml", @"image/*", nil];
    }
    return self;
}

@end
